<template>
    <div class="class-block">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="newPageNo"
        :page-size='newPageSize'
        layout="prev, pager, next, jumper"
        :total="total">
      </el-pagination>
    </div>
</template>

<script>
import Bus from './Bus'
    export default {
        data () {
            return {
                newPageNo: this.pageNo,
                newPageSize:this.pageSize,
                newTotal: this.newTotal
            }
        },
        props: {
            pageNo: Number,
            pageSize: Number,
            total: Number
        },
        methods: {
            // 分页
            handleCurrentChange(val) {
                // 获取角色列表数据
                Bus.$emit("getRoleList",val)
            },
            //修改当前长度
            handleSizeChange (val) {
                console.log(`当前长度: ${val}`);
            },
        }
    }
</script>

<style scoped>

</style>